[Store] feat: implements strict multi-tenant quota admission#2612
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the tenant quota management system to support a strict multi-tenant mode with connector-managed policies (e.g., YAML files), removing default fallback quotas and requiring explicit tenant registration. Key improvements include the introduction of a TenantQuotaPolicyStore for persistent policy management, updated admin APIs, and modified snapshot restore behavior. The review feedback highlights several optimization opportunities in MasterService, including pre-grouping tenant quotas by shard in ApplyTenantQuotaPolicies to reduce complexity, performing the TenantHasObjects check earlier in DeleteTenantQuotaPolicy to simplify rollback logic, and consolidating loops in RecomputeTenantEffectiveQuotas to avoid redundant double-locking of shard mutexes.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
6480029 to
1df4fd2
Compare
e3ad819 to
0bc3b0a
Compare
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Description
Part of #2153. Implements strict multi-tenant quota admission for Mooncake Store.
This PR replaces the inherited/default tenant quota model with a connector-backed policy source:
enable_multi_tenants,tenant_quota_connector_type, andtenant_quota_connector_uri.TenantQuotaPolicyStoreand a v1 YAML file connector with atomic writes.Module
mooncake-transfer-engine)mooncake-store)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
cmake --build build --target tenant_quota_test master_service_tenant_quota_test ctest --test-dir build -R "tenant_quota_test|master_service_tenant_quota_test" --output-on-failureTest results:
tenant_quota_testandmaster_service_tenant_quota_testpassed locally.Checklist
./scripts/code_format.shpre-commit run --all-filesand all hooks passAI Assistance Disclosure
Codex was used to help implement, review, test, and document this change. I reviewed and edited the generated code before submission.